/*
 * @(#)LogoutAction.java 1.0 2012/03/06
 *
 * Copyright (c) 
 *
 * 
 */

package mock.ab_sd.web.action;

import java.util.Map;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

/**
 * LogoutAction class 
 * @author QuyGP
 * @created 15/8/2012
 */
public class LogoutAction extends BaseAction{
	
	/** constant */
	private static final long serialVersionUID = 1L;
	
	/**
	 * override execute method of ActionSupport
	 * This method invokes logout method of LogoutBOImpl class
	 *    to update logout status of the user
	 * @author QuyGP
	 * @created 15/8/2012
	 */
	@SuppressWarnings("unchecked")
	@Override
	public String execute() throws Exception {
		
		/* create a Map names session,
		 * get session of the user and assign it to session
		 */
		Map<String, String> session = ActionContext.getContext().getSession();							
		session.remove("logon");
		return SUCCESS; // return the result of execution is successful
		
	}	
}
